﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/OneColumn.Master" AutoEventWireup="true"
    CodeBehind="ShoppingCart.aspx.cs" Inherits="CS424_9pts.ShoppingCart" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <div class="order-progress">
        <ul>
            <li>
                <asp:HyperLink runat="server" ID="hlCart" Text="Cart" CssClass="active-step" NavigateUrl="~/ShoppingCart.aspx">
                </asp:HyperLink></li>
            <li>
                <asp:HyperLink runat="server" ID="hlAddress" Text="Address" CssClass="inactive-step">
                </asp:HyperLink></li>
            <li>
                <asp:HyperLink runat="server" ID="hlShipping" Text="Shipping" CssClass="inactive-step">
                </asp:HyperLink></li>
            <li>
                <asp:HyperLink runat="server" ID="hlPayment" Text="Payment" CssClass="inactive-step">
                </asp:HyperLink></li>
            <li>
                <asp:HyperLink runat="server" ID="hlConfirm" Text="Confirm" CssClass="inactive-step">
                </asp:HyperLink></li>
            <li>
                <asp:HyperLink runat="server" ID="hlComplete" Text="Complete" CssClass="inactive-step">
                </asp:HyperLink></li>
        </ul>
    </div>
    <div class="shoppingcart-page">
        <div class="page-title">
            <h1>
                Shopping Cart</h1>
        </div>
        <div class="clear">
        </div>
        <div class="body">
            <asp:Panel class="order-summary-content" runat="server" ID="pnlEmptyCart">
                <%--    <%=GetLocaleResourceString("ShoppingCart.CartIsEmpty")%>--%>
            </asp:Panel>
            <asp:Panel class="order-summary-content" runat="server" ID="pnlCart">
                <asp:Panel runat="server" ID="pnlCommonWarnings" CssClass="warning-box" EnableViewState="false"
                    Visible="false">
                    <asp:Label runat="server" ID="lblCommonWarning" CssClass="warning-text" EnableViewState="false"
                        Visible="false"></asp:Label>
                </asp:Panel>
                <asp:GridView ID="GridView1" runat="server" SelectedIndex="0" EnableViewState="False">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Checked="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("ImageURL") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <%--<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />--%>
                <table class="cart">
                    <thead>
                        <tr class="cart-header-row">
                            <th>
                                Remove
                            </th>
                            <th class="picture">
                            </th>
                            <th>
                                Product(s)
                            </th>
                            <th>
                                Price
                            </th>
                            <th>
                                Qty.
                            </th>
                            <th class="end">
                                Total
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="rptShoppingCart" runat="server">
                            <ItemTemplate>
                                <tr class="cart-item-row">
                                    <td>
                                        <asp:CheckBox ID="cbRemoveFromCart" runat="server" />
                                    </td>
                                    <td class="productpicture">
                                        <asp:Image ID="iProductVariantPicture" runat="server" AlternateText="Product picture" />
                                    </td>
                                    <td class="product">
                                        <%--    <%#Server.HtmlEncode(GetProductVariantName((ShoppingCartItem)Container.DataItem))%></a>
                            <%#GetAttributeDescription((ShoppingCartItem)Container.DataItem)%>
                            <%#GetRecurringDescription((ShoppingCartItem)Container.DataItem)%>--%>
                                        <asp:Panel ID="pnlWarnings" runat="server" CssClass="warning-box" EnableViewState="false"
                                            Visible="false">
                                            <asp:Label ID="lblWarning" runat="server" CssClass="warning-text" EnableViewState="false"
                                                Visible="false"></asp:Label>
                                        </asp:Panel>
                                        </a>
                                    </td>
                                    <td style="white-space: nowrap;">
                                        <asp:Label ID="lblPriceUnit" runat="server">Price</asp:Label>
                                    </td>
                                    <td style="white-space: nowrap;">
                                        <asp:TextBox ID="txtQuantity" runat="server" size="4" SkinID="ShoppingCartQuantityText" />
                                    </td>
                                    <td class="end" style="white-space: nowrap;">
                                        <asp:Label ID="lblShoppingCartItemId" runat="server" Visible="false" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr>
                            <td>
                                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="clear">
                </div>
                <div class="selected-checkout-attributes">
                </div>
                <div class="clear">
                </div>
                <div class="cart-footer">
                    <div class="common-buttons">
                        <asp:Button ID="btnUpdate" runat="server" Text="Update Cart" CssClass="updatecartbutton"
                            OnClick="Button2_Click" />
                        <asp:Button ID="btnContinueShopping" runat="server" Text="Continue Shopping" CssClass="continueshoppingbutton"
                            OnClick="btnContinueShopping_Click" />
                    </div>
                    <div class="clear">
                    </div>
                    <div class="totals">
                        <div class="total-info">
                            <table class="cart-total">
                                <tbody>
                                    <tr>
                                        <td class="cart_total_left">
                                            <strong><span style="white-space: nowrap;">Sub-Total:</span></strong> ``
                                        </td>
                                        <td class="cart_total_right">
                                            <span style="white-space: nowrap;">
                                                <asp:Label ID="lblSubTotalAmount" runat="server" CssClass="productPrice" />
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="cart_total_right">
                                            <span style="white-space: nowrap;">
                                                <asp:Label ID="lblTotalAmount" runat="server" CssClass="productPrice" />
                                            </span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="clear">
                    </div>
                    <div class="checkout-buttons">
                        <asp:Button ID="btnCheckout" runat="server" Text="Checkout" CssClass="checkoutbutton"
                            OnClick="btnCheckout_Click" />
                    </div>
            </asp:Panel>
        </div>
    </div>
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataKeyNames="CarID"
        DataSourceID="SqlDataSource2">
        <Columns>
            <asp:BoundField DataField="CarID" HeaderText="CarID" InsertVisible="False" ReadOnly="True"
                SortExpression="CarID" />
            <asp:BoundField DataField="BrandID" HeaderText="BrandID" SortExpression="BrandID" />
            <asp:BoundField DataField="CarModel" HeaderText="CarModel" SortExpression="CarModel" />
            <asp:BoundField DataField="CartId" HeaderText="CartId" SortExpression="CartId" />
            <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
            <asp:BoundField DataField="Count" HeaderText="Count" SortExpression="Count" />
            <asp:BoundField DataField="DateCreated" HeaderText="DateCreated" SortExpression="DateCreated" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
        SelectCommand="SELECT [CarID], [BrandID], [CarModel], [CartId], [Status], [Count], [DateCreated] FROM [Car]">
    </asp:SqlDataSource>
</asp:Content>

